package com.example.demo.controller;

import com.example.demo.domain.Course;
import com.example.demo.domain.Course;
import com.example.demo.service.CourseService;
import com.example.demo.service.StudentService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/cou")
public class CourseController {

    @Autowired
    private CourseService service;

    @RequestMapping("/getAll")
    public List<Course> getAll(){
        System.out.println("进入方法--");
        List<Course> all = service.getAll();

        return all;
    }

    @RequestMapping("/getById")
    public Course getById(@Param("cid") String cid){
        System.out.println("进入方法--");
        return service.getById(cid);
    }
}
